package com.yxh.bigdata.mapreduce.join;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class JoinOrderBean implements Writable {

    private String oid;
    private String odate;
    private String amount;
    private String pid;
    private String pname;
    private String price;

    public JoinOrderBean() {
    }

    public JoinOrderBean(String oid, String odate, String amount, String pid) {
        this.oid = oid;
        this.odate = odate;
        this.amount = amount;
        this.pid = pid;
    }

    public JoinOrderBean(String pid, String pname, String price) {
        this.pid = pid;
        this.pname = pname;
        this.price = price;
    }

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public String getOdate() {
        return odate;
    }

    public void setOdate(String odate) {
        this.odate = odate;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(oid);
        dataOutput.writeUTF(odate);
        dataOutput.writeUTF(amount);
        dataOutput.writeUTF(pid);
        dataOutput.writeUTF(pname);
        dataOutput.writeUTF(price);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        oid = dataInput.readUTF();
        odate = dataInput.readUTF();
        amount = dataInput.readUTF();
        pid = dataInput.readUTF();
        pname = dataInput.readUTF();
        price = dataInput.readUTF();
    }
}
